UX Advanced PropertiesServer-side onBeforePopulateUXControlsFromTable Event
Description
An Xbasic function to call before a data bound UX component is populated with data from one or more tables
The is an Xbasic function that is called before populating a data-bound UX Component with data from tables. The function can be used to authorize or deny permission to view a specific record. For example:
function onBeforePopulate as c (e as p) key = e.primaryKey if ("B" $ key) then e.authorized = .t. else e.authorized = .f. e.javascript = "alert('You do not have authorization to view this account.');" end if end function
The Xbasic function is passed a dot variable called e that contains the following properties:
- Argument
- Description
- e.tmpl
A dot variable that contains the UX definition.
- e.primaryKey
The primary key for the record to be retrieved.
You can set the following properties in the e variable in your Xbasic function to restrict access to data, as well as return JavaScript to execute in the case that access is denied:
- e.authorized
A logical variable. The value can be .t. or .f.. If set to .f., the record is not fetched. If set to .t. or not set, the record is fetched.
- e.javascript
Optional JavaScript to execute on the client. The JavaScript is only executed if e.authorized is set to .f..